package org.child_motivation.business.service;

import org.child_motivation.business.model.Group;
import org.child_motivation.integration.dao.GroupDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class DefaultGroupService implements GroupService {

    @Autowired
    GroupDao groupDao;

    @Override
    public void saveOrUpdate(Group group) {
        groupDao.saveOrUpdate(group);
    }

    @Override
    public void deleteGroup(int groupid) {
        groupDao.deleteGroup(groupid);

    }

    @Override
    public List<Group> getGroups(String owner) {
        return groupDao.getGroups(owner);
    }

    @Override
    public Group getGroup(int id) {
        return groupDao.getGroup(id);
    }
}
